package com.treeHole.treeHoleServer.mapper;


import com.treeHole.treeHoleServer.pojo.Comment;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface CommentMapper {
    int insertLikeCommentRecord(Integer commentId, Integer userId,String likeDate);
    int deleteLikeCommentRecord(Integer commentId, Integer userId);

    int postNewComment(Comment comment);
    int deleteComment(Integer commentId);

    List<Comment> getUserComment(Integer userId, Integer offset);
    List<Comment> getPostComment(Integer postId, Integer offset);

    String getSpecificUserNameInPost(Integer userId, Integer postId);
    List<String> getAllUserNameInPost(Integer postId);
    Integer getUserIdFromUserName(String userName, Integer postId);

    Integer getCommentLikeCount(Integer commentId);
    List<Integer> getUserIsLikeComment(Integer userId, Integer commentId);

    //获取用户是否评论了某个帖子
    List<Integer> getUserIsCommentPost(Integer postId, Integer userId);
}
